package com.ieheima.zixi;

import java.io.*;
import java.nio.charset.Charset;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw = new OutputStreamWriter(
                new FileOutputStream("day13\\aaa\\a.txt"),"GBK");
        osw.write("中国人");
        osw.close();

        InputStreamReader isr = new InputStreamReader(
                new FileInputStream("day13\\aaa\\a.txt"), Charset.forName("GBK"));
        int read;
        while ((read = isr.read()) != -1) {
            System.out.print((char) read);
        }
        isr.close();
    }
}
